﻿///////////////////////////////////////////////////////////////////////////
//  Copyright(c) 2022,GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007
//
/// @file    himpp_extension.h
/// @brief   文件简要描述
/// @version 0.1
/// @history 修改历史
/// @warning 没有警告
///////////////////////////////////////////////////////////////////////////
#ifndef __HIMPP_EXTENSION_H__
#define __HIMPP_EXTENSION_H__

#include "klb_type.h"
#include "klua/klua.h"
#include "klua/klua_env.h"
#include "hiobj.h"
#include "klbmem/klb_buf.h"

#if defined(__cplusplus)
extern "C" {
#endif

#define HIMPP_EXTENSION             "_HIMPP_EXTENSION_"
#define HIMPP_EXTENSION_BUF_COUNT   HIOBJ_mem_max


typedef struct himpp_extension_t_ himpp_extension_t;


himpp_extension_t* himpp_ex_get(klua_env_t* p_env);
himpp_extension_t* himpp_ex_get_by_L(lua_State* L);


int himpp_ex_add(himpp_extension_t* p_ex, hiobj_reg_t* p_reg);

hiobj_reg_t* himpp_ex_find(himpp_extension_t* p_ex, const char* p_name);


/// @brief 获取临时缓存
/// @param [in]  *p_ex          扩展模块
/// @return klb_buf_t* 返回值
klb_buf_t* himpp_ex_tmp_buf(himpp_extension_t* p_ex, int idx);


#ifdef __cplusplus
}
#endif

#endif // __HIMPP_EXTENSION_H__
//end
